package com.isoft.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

import java.util.Date;

/**
 * 机场基础信息表
 * @TableName airport_info
 */
@TableName(value ="airport_info")
@Data
public class AirportInfo implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;



    /**
     * 机场三字码
     */
    private String code;

    /**
     * 机场四字码
     */
    private String frcd;

    /**
     * 机场属性:2401=国际/2402=地区/2403=国内/2404=混合
     */
    private String apat;

    /**
     * 机场中文名称
     */
    private String cnnm;

    /**
     * 机场英文名称
     */
    private String ennm;

    /**
     * 机场启用状态(O=启用)
     */
    private String aiso;

    /**
     * 机场简称
     */
    private String apsn;

    /**
     * 数据来源文件名
     */
    private String sourceFile;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AirportInfo other = (AirportInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
                && (this.getFrcd() == null ? other.getFrcd() == null : this.getFrcd().equals(other.getFrcd()))
                && (this.getApat() == null ? other.getApat() == null : this.getApat().equals(other.getApat()))
                && (this.getCnnm() == null ? other.getCnnm() == null : this.getCnnm().equals(other.getCnnm()))
                && (this.getEnnm() == null ? other.getEnnm() == null : this.getEnnm().equals(other.getEnnm()))
                && (this.getAiso() == null ? other.getAiso() == null : this.getAiso().equals(other.getAiso()))
                && (this.getApsn() == null ? other.getApsn() == null : this.getApsn().equals(other.getApsn()))
                && (this.getSourceFile() == null ? other.getSourceFile() == null : this.getSourceFile().equals(other.getSourceFile()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getFrcd() == null) ? 0 : getFrcd().hashCode());
        result = prime * result + ((getApat() == null) ? 0 : getApat().hashCode());
        result = prime * result + ((getCnnm() == null) ? 0 : getCnnm().hashCode());
        result = prime * result + ((getEnnm() == null) ? 0 : getEnnm().hashCode());
        result = prime * result + ((getAiso() == null) ? 0 : getAiso().hashCode());
        result = prime * result + ((getApsn() == null) ? 0 : getApsn().hashCode());
        result = prime * result + ((getSourceFile() == null) ? 0 : getSourceFile().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", code=").append(code);
        sb.append(", frcd=").append(frcd);
        sb.append(", apat=").append(apat);
        sb.append(", cnnm=").append(cnnm);
        sb.append(", ennm=").append(ennm);
        sb.append(", aiso=").append(aiso);
        sb.append(", apsn=").append(apsn);
        sb.append(", sourceFile=").append(sourceFile);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}